<script>
    function changeButtonValue() {
        var b = document.getElementById("ee");
        b.value = b.value == 'AAA' ? 'BBB' : 'AAA';
    }
</script>
<a href="https://zhidao.baidu.com/question/333583152713202165.html?qbl=relate_question_0">1.点击按钮后文字改变,再点击后变回原来的文字</a>

<input type="button" value="按钮上的文字" data-v="bbb" onclick="
var s=this.value;
this.value=this.dataset.v;
this.dataset.v=s;"/>

<p>2.点击下面文字会在AAA,BBB之间来回切换<p>
    <span onclick="javascript:this.innerHTML=(this.innerHTML=='AAA'?'BBB':'AAA');">AAA</span>


<p>3.点击按钮后,按钮的文字改变,再点击后变回原来的文字</a>
<form>
    <input type="button" id="ee" value="AAA" onclick="javascript:changeButtonValue();"/>
</form>